//
//  BJLaunchViewController.m
//  BowJoy
//
//  Created by  on 2024/5/14.
//

#import "BJLaunchViewController.h"
#import "BJGuidePageView.h"
@interface BJLaunchViewController ()

@end

@implementation BJLaunchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];


    

    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"isFristOpen"];
    BJGuidePageView *guidePage = [[BJGuidePageView alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
    guidePage.duration = 3.0;
    [self.view addSubview:guidePage];
    
    guidePage.toNextVC = ^{
        if (self.loadDataCallBack) {
            self.loadDataCallBack();
        }
    };
    NSMutableArray *dataList = [NSMutableArray array];
    NSDictionary *dict = @{
        @"page":@"launch",
        @"duration":@(0),
        @"event":@"pv",
        @"tm":@([[BJNetManager shareNetManager] gs_getCurrentTimeToMilliSecond]),
    };
    [dataList addObject:dict];
    [[BJNetManager shareNetManager]postLogWithParam:dataList];
    // Do any additional setup after loading the view from its nib.
}

//获取是否登录
//-(void)getLoginData{
//    kWeakSelf(weakSelf)
//    [[BJNetManager shareNetManager] postIsValidTokenWithCompletionHandler:^(id  _Nonnull responOj, NSError * _Nonnull error) {
//        BOOL isLogin = false;
//        if(responOj[@"data"]){
//            isLogin = [responOj[@"data"] boolValue];
//        }
//        [weakSelf getGetStrategyDataIsLogin:isLogin];
//    }];
//}

//获取策略数据
//-(void)getGetStrategyDataIsLogin:(BOOL)isLogin{
//    if(isLogin){
//        //获取策略数据的前提是必须登录了
//        kWeakSelf(weakSelf)
//        [[BJNetManager shareNetManager] getGetStrategyWithCompletionHandler:^(id   responOj, NSError * _Nonnull error) {
//            if (weakSelf.loadDataCallBack){
//                weakSelf.loadDataCallBack(isLogin);
//            }
//        }];
//    }else{
//        if (self.loadDataCallBack){
//            self.loadDataCallBack(isLogin);
//        }
//    }
//}
//

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
